<?php
require_once 'config.php';
require_once 'Zend/Controller/Front.php';
require_once 'Zend/Controller/Action.php';
require_once 'Zend/View.php';
require_once 'Zend/Layout.php';
require_once 'Zend/View/Helper/Abstract.php';

function throwException($exception) {
	header('Location: ' . __PROJECTNAME__ . '/error?status=' . $exception->getCode() . '&error_obj=' . urlencode($exception->getMessage()));
	exit;
}
set_exception_handler('throwException');

$controller = Zend_Controller_Front::getInstance();
$controller->setControllerDirectory(array(
    'default'		=>  '../application/default/controllers',
    'admin'     	=>  '../application/admin/controllers'
));

//$controller->setParam('noViewRenderer',true);
$controller->throwExceptions(DEVELOPMENT);
$controller->dispatch();